up: programming:windows:windows  
programming windows
windows class registration
What links here?
This tells the operating system about your window

    // use 'LoadImage' to load wnd class icon and cursor as it supercedes 
    // the obsolete functions 'LoadIcon' and 'LoadCursor', although these 
    // functions will still work. Because the icon and cursor are loaded 
    // from system resources ie they are shared, it is not necessary to 
    // free the image resources with either 'DestroyIcon' or 'DestroyCursor'.


hIcon=(HICON)LoadImage(0,IDI_APPLICATION,IMAGE_ICON,0,0,LR_SHARED); hCursor=(HCURSOR)LoadImage(0,IDC_ARROW,IMAGE_CURSOR,0,0,LR_SHARED); wcx.cbSize = sizeof(WNDCLASSEX); //byte size of WNDCLASSEX struct wcx.style = CS_HREDRAW|CS_VREDRAW; //ensure wnd is always redrawn wcx.lpfnWndProc = (WNDPROC)MainWndWndProc; //pointer to the Window Procedure wcx.cbClsExtra = 0; //Extra bytes for 'class' wnds wcx.cbWndExtra = 0; //Extra bytes for this wnd wcx.hInstance = hInstance; //Application instance wcx.hIcon = hIcon; //Application icon wcx.hCursor = hCursor; //Cursor for wnd wcx.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); //Background wnd colour wcx.lpszMenuName = TEXT("MainMenu"); //Name of window menu wcx.lpszClassName = chClassName; //Name of this wnd 'class' wcx.hIconSm = NULL; //Icon in top-left corner of wnd

//Register the wnd class with the Windows system if (!RegisterClassEx(&wcx)) { //Registration has failed so inform the user MessageBox( NULL, TEXT("Failed to register wnd class"), TEXT("ERROR"), MB_OK|MB_ICONERROR); return FALSE; }
programming - windows - windows class registration
filename:programming - windows - windows class registration
filename:programming%20%2D%20windows%20%2D%20windows%20class%20registration
last edit:March 24 2010 19:22:42 (5156 days ago)
ct = 1714952826.000000 = May 05 2024 19:47:06
ft = 1269472962.000000 = March 24 2010 19:22:42
dt = 445479864.000000